Skip to content

Conversation

@dianqk
Copy link
Member

@dianqk dianqk commented Dec 29, 2025

Fixes #141313. This is a more principled fix than #147886.

Using a reference that is not a borrowing of an SSA local at a new location may be UB.

The PR has two major changes.

The first one, when introducing a new dereference at a new location, is that the reference must point to an SSA local or be an immutable argument. dereference_address has handled SSA locals.

The second one, if we cannot guard to the reference point to an SSA local in visit_assign, we have to rewrite the value to opaque. This avoids unifying the following dereferences that also are references:

let b: &T = *a;
// ... `a` is allowed to be modified. `c` and `b` have different borrowing lifetime.
// Unifying them will extend the lifetime of `b`.
let c: &T = *a; 

See also #130853.

This still allows unifying non-reference dereferences:

let a: &T = ...;
let b: T = *a;
// ... a is NOT allowed to be modified.
let c: T = *a; 

r? @cjgillot

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2025
@rust-log-analyzer

This comment has been minimized.

@dianqk
Copy link
Member Author

dianqk commented Jan 1, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 1, 2026
[DRAFT] GVN: Only propagate borrows from SSA-locals
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 1, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 2, 2026

☀️ Try build successful (CI)
Build commit: f23e5de (f23e5de34a174f8bd281d69038b68bf6332b1af6, parent: fcd630976c460c819c4bbcaf107d0c94501205d8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f23e5de): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.1%, 0.9%] 20
Regressions ❌
(secondary)
0.4% [0.1%, 2.0%] 27
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 4
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 7
All ❌✅ (primary) 0.1% [-1.2%, 0.9%] 24

Max RSS (memory usage)

Results (primary -1.1%, secondary -4.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.4% [1.9%, 2.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.4% [-6.8%, -0.6%] 3
Improvements ✅
(secondary)
-4.7% [-6.5%, -3.7%] 3
All ❌✅ (primary) -1.1% [-6.8%, 2.8%] 5

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary 0.1%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.0%, 6.9%] 11
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 14
Improvements ✅
(primary)
-0.1% [-1.0%, -0.0%] 27
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) 0.1% [-1.0%, 6.9%] 38

Bootstrap: 475.254s -> 472.456s (-0.59%)
Artifact size: 390.85 MiB -> 390.82 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 2, 2026
@dianqk
Copy link
Member Author

dianqk commented Jan 2, 2026

@bors try parent=fcd630976c460c819c4bbcaf107d0c94501205d8 @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 2, 2026
[DRAFT] GVN: Only propagate borrows from SSA-locals
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 2, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 2, 2026

☀️ Try build successful (CI)
Build commit: 2183340 (218334063dc5d70b7f9d69202bf22750167c6cbf, parent: fcd630976c460c819c4bbcaf107d0c94501205d8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2183340): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.1%, 0.9%] 17
Regressions ❌
(secondary)
0.3% [0.1%, 0.8%] 23
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 4
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 8
All ❌✅ (primary) 0.1% [-1.2%, 0.9%] 21

Max RSS (memory usage)

Results (primary -1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-4.6%, -0.6%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.9% [-4.6%, 1.7%] 4

Cycles

Results (secondary -2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.2%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.0%, 6.9%] 11
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 14
Improvements ✅
(primary)
-0.2% [-0.9%, -0.0%] 11
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) 0.2% [-0.9%, 6.9%] 22

Bootstrap: 475.254s -> 472.783s (-0.52%)
Artifact size: 390.85 MiB -> 390.84 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 2, 2026
@rust-log-analyzer

This comment has been minimized.

@dianqk
Copy link
Member Author

dianqk commented Jan 17, 2026

@bors try @rust-timer queue

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 27, 2026

☀️ Try build successful (CI)
Build commit: 9144e45 (9144e455f9d6fc82dc56f796e4a05c199fc00e26, parent: fe98ddcfcfb6f185dbf4adeaf439d8a756da0273)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9144e45): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.3%] 3
Regressions ❌
(secondary)
0.3% [0.0%, 0.5%] 16
Improvements ✅
(primary)
-0.6% [-1.0%, -0.2%] 6
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 6
All ❌✅ (primary) -0.3% [-1.0%, 0.3%] 9

Max RSS (memory usage)

Results (primary 1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.9% [4.3%, 5.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-4.1%, -1.5%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [-4.1%, 5.4%] 4

Cycles

Results (secondary 4.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [3.2%, 5.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.2%] 10
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.9%, -0.0%] 63
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 32
All ❌✅ (primary) -0.1% [-0.9%, 0.2%] 73

Bootstrap: 473.229s -> 473.457s (0.05%)
Artifact size: 383.52 MiB -> 383.46 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 27, 2026
@Kobzol
Copy link
Member

Kobzol commented Jan 27, 2026

The above commit had a compilation failure in rustc-perf (not sure why it wasn't shown in the above comment):

Cannot compile diesel-2.2.10

Caused by:
    expected success, got exit status: 101
    
    stderr= Documenting diesel v2.2.10 (/tmp/.tmpLrTEsL)
    error: internal compiler error: src/librustdoc/passes/collect_intra_doc_links.rs:369:17: no resolution for "define_sql_function" MacroNS DefId(0:458 ~ diesel[1eca]::expression::functions)
     --> src/expression/functions/mod.rs:8:9
      |
    8 | pub use diesel_derives::sql_function_proc as sql_function;
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    
    thread 'rustc' (3092251) panicked at src/librustdoc/passes/collect_intra_doc_links.rs:369:17:
    Box<dyn Any>
    stack backtrace:
       0:     0x7ffff4e3e453 - <<std[3dbaae3c7a1ef610]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a41ff54a4628db4]::fmt::Display>::fmt
       1:     0x7ffff540e2c8 - core[a41ff54a4628db4]::fmt::write
       2:     0x7ffff4e54e46 - <std[3dbaae3c7a1ef610]::sys::stdio::unix::Stderr as std[3dbaae3c7a1ef610]::io::Write>::write_fmt
       3:     0x7ffff4e144c8 - std[3dbaae3c7a1ef610]::panicking::default_hook::{closure#0}
       4:     0x7ffff4e31b83 - std[3dbaae3c7a1ef610]::panicking::default_hook
       5:     0x7ffff3dfe4ba - std[3dbaae3c7a1ef610]::panicking::update_hook::<alloc[89a0aff19674fbeb]::boxed::Box<rustc_driver_impl[f6da089e2ca492f4]::install_ice_hook::{closure#1}>>::{closure#0}
       6:     0x7ffff4e31e62 - std[3dbaae3c7a1ef610]::panicking::panic_with_hook
       7:     0x7ffff3e3b3b1 - std[3dbaae3c7a1ef610]::panicking::begin_panic::<rustc_errors[a911626fb4b1466a]::ExplicitBug>::{closure#0}
       8:     0x7ffff3e2b666 - std[3dbaae3c7a1ef610]::sys::backtrace::__rust_end_short_backtrace::<std[3dbaae3c7a1ef610]::panicking::begin_panic<rustc_errors[a911626fb4b1466a]::ExplicitBug>::{closure#0}, !>
       9:     0x7ffff3e28ca9 - std[3dbaae3c7a1ef610]::panicking::begin_panic::<rustc_errors[a911626fb4b1466a]::ExplicitBug>
      10:     0x7ffff3e59171 - <rustc_errors[a911626fb4b1466a]::diagnostic::BugAbort as rustc_errors[a911626fb4b1466a]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
      11:     0x7ffff43e797c - <rustc_errors[a911626fb4b1466a]::DiagCtxtHandle>::span_bug::<rustc_span[1c18fc65a3f0817e]::span_encoding::Span, alloc[89a0aff19674fbeb]::string::String>
      12:     0x7ffff440a446 - rustc_middle[b228808e31d1501d]::util::bug::opt_span_bug_fmt::<rustc_span[1c18fc65a3f0817e]::span_encoding::Span>::{closure#0}
      13:     0x7ffff440a5f2 - rustc_middle[b228808e31d1501d]::ty::context::tls::with_opt::<rustc_middle[b228808e31d1501d]::util::bug::opt_span_bug_fmt<rustc_span[1c18fc65a3f0817e]::span_encoding::Span>::{closure#0}, !>::{closure#0}
      14:     0x7ffff43fbc5b - rustc_middle[b228808e31d1501d]::ty::context::tls::with_context_opt::<rustc_middle[b228808e31d1501d]::ty::context::tls::with_opt<rustc_middle[b228808e31d1501d]::util::bug::opt_span_bug_fmt<rustc_span[1c18fc65a3f0817e]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
      15:     0x7ffff1d788e8 - rustc_middle[b228808e31d1501d]::util::bug::span_bug_fmt::<rustc_span[1c18fc65a3f0817e]::span_encoding::Span>
      16:     0x555555d769a5 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
      17:     0x555555d770dc - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector>::resolve
      18:     0x555555d8cc85 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector>::resolve_link
      19:     0x555555cc17b9 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector>::resolve_links::{closure#0}
      20:     0x555555eda1f9 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector as rustdoc[93212c950406fead]::visit::DocVisitor>::visit_item
      21:     0x555555eda779 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector as rustdoc[93212c950406fead]::visit::DocVisitor>::visit_item
      22:     0x555555eda779 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector as rustdoc[93212c950406fead]::visit::DocVisitor>::visit_item
      23:     0x555555eda779 - <rustdoc[93212c950406fead]::passes::collect_intra_doc_links::LinkCollector as rustdoc[93212c950406fead]::visit::DocVisitor>::visit_item
      24:     0x555555dbf712 - rustdoc[93212c950406fead]::core::run_global_ctxt
      25:     0x555555caf1f5 - rustdoc[93212c950406fead]::main_args::{closure#2}::{closure#0}
      26:     0x555555ca62ad - rustc_interface[603cb3fea7fc41db]::interface::run_compiler::<(), rustdoc[93212c950406fead]::main_args::{closure#2}>::{closure#1}
      27:     0x555555bdd8a6 - std[3dbaae3c7a1ef610]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[603cb3fea7fc41db]::util::run_in_thread_with_globals<rustc_interface[603cb3fea7fc41db]::util::run_in_thread_pool_with_globals<rustc_interface[603cb3fea7fc41db]::interface::run_compiler<(), rustdoc[93212c950406fead]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
      28:     0x555555cd6097 - <std[3dbaae3c7a1ef610]::thread::lifecycle::spawn_unchecked<rustc_interface[603cb3fea7fc41db]::util::run_in_thread_with_globals<rustc_interface[603cb3fea7fc41db]::util::run_in_thread_pool_with_globals<rustc_interface[603cb3fea7fc41db]::interface::run_compiler<(), rustdoc[93212c950406fead]::main_args::{closure#2}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[a41ff54a4628db4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      29:     0x7ffff6587384 - <std[3dbaae3c7a1ef610]::sys::thread::unix::Thread>::new::thread_start
      30:     0x7fffefe9caa4 - <unknown>
      31:     0x7fffeff29c6c - <unknown>
      32:                0x0 - <unknown>
    
    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
    
    note: please make sure that you have updated to the latest nightly
    
    note: please attach the file at `/tmp/.tmpLrTEsL/rustc-ice-2026-01-27T16_38_32-3092250.txt` to your bug report
    
    note: rustc 1.94.0-nightly (9144e455f 2026-01-27) running on x86_64-unknown-linux-gnu
    
    note: compiler flags: --crate-type lib -Z incremental-verify-ich -Z self-profile=/tmp/.tmpLrTEsL/self-profile-output-3092243-1769531910561
    
    note: some of the compiler flags provided by cargo are hidden
    
    query stack during panic:
    end of query stack
    
    thread 'main' (3092243) panicked at collector/src/bin/rustc-fake.rs:31:5:
    command did not complete successfully: LC_NUMERIC="C" RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="rustc-perf" RUSTC_FORCE_RUSTC_VERSION="rustc-perf" "perf" "stat" "-x;" "-e" "instructions:u,cycles:u,task-clock,cpu-clock,faults,context-switches,branch-misses,cache-misses" "--log-fd" "1" "setarch" "x86_64" "-R" "/home/collector/rustc-perf/cache/9144e455f9d6fc82dc56f796e4a05c199fc00e26/x86_64-unknown-linux-gnu/toolchain/bin/rustdoc" "--edition=2021" "--crate-type" "lib" "--crate-name" "diesel" "src/lib.rs" "-o" "/tmp/.tmpLrTEsL/target/doc" "--cfg" "feature=\"32-column-tables\"" "--cfg" "feature=\"default\"" "--cfg" "feature=\"with-deprecated\"" "--check-cfg" "cfg(docsrs,test)" "--check-cfg" "cfg(feature, values(\"128-column-tables\", \"32-column-tables\", \"64-column-tables\", \"__with_asan_tests\", \"chrono\", \"default\", \"extras\", \"huge-tables\", \"i-implement-a-third-party-backend-and-opt-into-breaking-changes\", \"ipnet-address\", \"large-tables\", \"mysql\", \"mysql_backend\", \"mysqlclient-src\", \"network-address\", \"numeric\", \"postgres\", \"postgres_backend\", \"pq-src\", \"quickcheck\", \"r2d2\", \"returning_clauses_for_sqlite_3_35\", \"serde_json\", \"sqlite\", \"time\", \"unstable\", \"uuid\", \"with-deprecated\", \"without-deprecated\"))" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "-C" "metadata=c57c96744c57e10d" "-L" "dependency=/tmp/.tmpLrTEsL/target/debug/deps" "--extern" "diesel_derives=/tmp/.tmpLrTEsL/target/debug/deps/libdiesel_derives-e4720f68c759cc80.so" "--crate-version" "2.2.10" "-Adeprecated" "-Aunknown-lints" "-Zincremental-verify-ich" "-Zself-profile=/tmp/.tmpLrTEsL/self-profile-output-3092243-1769531910561"
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    error: could not document `diesel`
    
    
     stdout=18556152708;;instructions:u;2295111901;100.00;1.74;insn per cycle
    10654780770;;cycles:u;2295111901;100.00;;
    2295.11;msec;task-clock;2295111901;100.00;1.000;CPUs utilized
    2295.10;msec;cpu-clock;2295111901;100.00;1.000;CPUs utilized
    133801;;faults;2295111901;100.00;58.298;K/sec
    15;;context-switches;2295111901;100.00;6.536;/sec
    49854508;;branch-misses;2295111901;100.00;;
    97470616;;cache-misses;2295111901;100.00;;
    

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@dianqk
Copy link
Member Author

dianqk commented Jan 28, 2026

I assume it is #151255.

@dianqk
Copy link
Member Author

dianqk commented Jan 28, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
GVN: Only propagate borrows from SSA locals
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 28, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 28, 2026

☀️ Try build successful (CI)
Build commit: 0e5b1a1 (0e5b1a1b4144d4e37e094f7d74087be1e0077bfb, parent: e96bb7e44fbcc23c1e6009e8d0ee8ab208668fb4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0e5b1a1): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.3%] 33
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 25
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 3
Improvements ✅
(secondary)
-0.1% [-0.3%, -0.1%] 9
All ❌✅ (primary) 0.2% [-1.2%, 0.3%] 36

Max RSS (memory usage)

Results (primary -0.9%, secondary -2.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.0% [2.3%, 3.6%] 2
Regressions ❌
(secondary)
2.1% [1.5%, 3.1%] 3
Improvements ✅
(primary)
-2.2% [-3.7%, -1.4%] 6
Improvements ✅
(secondary)
-4.4% [-5.4%, -0.5%] 8
All ❌✅ (primary) -0.9% [-3.7%, 3.6%] 8

Cycles

Results (primary 2.9%, secondary 3.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.9% [1.6%, 4.5%] 22
Regressions ❌
(secondary)
4.2% [1.9%, 8.8%] 41
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.2% [-4.2%, -4.1%] 2
All ❌✅ (primary) 2.9% [1.6%, 4.5%] 22

Binary size

Results (primary 0.0%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 8
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 15
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 9
All ❌✅ (primary) 0.0% [-0.1%, 0.3%] 23

Bootstrap: 470.891s -> 474.803s (0.83%)
Artifact size: 383.44 MiB -> 385.80 MiB (0.62%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 28, 2026
@dianqk
Copy link
Member Author

dianqk commented Jan 28, 2026

It's weird.
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 28, 2026
GVN: Only propagate borrows from SSA locals
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 28, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 28, 2026

☀️ Try build successful (CI)
Build commit: f1385c1 (f1385c1681402a00f99d1eb766520242f9fde309, parent: 466ea4e6c39f8a43727edcc726ca86b499e14d83)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f1385c1): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.3%] 6
Regressions ❌
(secondary)
0.6% [0.1%, 1.0%] 10
Improvements ✅
(primary)
-0.6% [-1.1%, -0.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-1.1%, 0.3%] 8

Max RSS (memory usage)

Results (primary -1.9%, secondary -2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-5.3%, -1.7%] 6
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) -1.9% [-5.3%, 3.1%] 7

Cycles

Results (primary -1.9%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-1.9% [-1.9%, -1.9%] 1
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) -1.9% [-1.9%, -1.9%] 1

Binary size

Results (primary 0.0%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.4%] 7
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 15
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 8
All ❌✅ (primary) 0.0% [-0.1%, 0.4%] 22

Bootstrap: 476.499s -> 476.268s (-0.05%)
Artifact size: 397.91 MiB -> 397.83 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GVN misunderstands aliasing, can create overlapping assignments (again)

6 participants